﻿using LimaLims.Application.Service.Base.Dto;
using LimaLims.Core;
using LimaLims.Core.Enum;
using LimaLims.Core.Util;

namespace LimaLims.Application.Service.Basic.Dto
{
    public class AddInspectionItemInput : BaseDto
    {
        /// <summary>
        /// 项目编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>
        public string InspectionName { get; set; }

        /// <summary>
        /// 试验项目类别
        /// </summary>
        public InspectionType InspectionType { get; set; }

        /// <summary>
        /// 国标值
        /// </summary>
        public float? NsTargetValue { get; set; }

        /// <summary>
        /// 规格下限
        /// </summary>
        public float? NsLowerLimit { get; set; }

        /// <summary>
        /// 规格上限
        /// </summary>
        public float? NsUpperLimit { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    /// <summary>
    /// 批量添加项目INPUT
    /// </summary>
    public class BatchInspectionItemInput
    {
        /// <summary>
        /// 试验项目类别
        /// </summary>
        public InspectionType InspectionType { get; set; }

        /// <summary>
        /// 试验项目集合
        /// </summary>
        public ICollection<AddInspectionItemInput> InspectionItems { get; set; }
    }

    public class EditInspectionItemInput : AddInspectionItemInput
    {

    }

    public class InspectionItemOutput : BaseDto
    {    
        /// <summary>
        /// 项目编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>
        public string InspectionName { get; set; }

        /// <summary>
        /// 试验项目类别
        /// </summary>
        public InspectionType InspectionType { get; set; }

        /// <summary>
        /// 试验项目类别文本
        /// </summary>
        public string InspectionTypeText => InspectionType.GetDescription();

        /// <summary>
        /// 国标值
        /// </summary>
        public float? NsTargetValue { get; set; }

        /// <summary>
        /// 规格下限
        /// </summary>
        public float? NsLowerLimit { get; set; }

        /// <summary>
        /// 规格上限
        /// </summary>
        public float? NsUpperLimit { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    /// <summary>
    /// 试验项目查询
    /// </summary>
    public class InspectionItemPageInput : PageInputBase
    {
        /// <summary>
        /// 试验类型
        /// </summary>
        public InspectionType? InspectionType { get; set; }
    }
}
